package com.hujf.netty.inandoutboundhandler;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

/**
 * @author Hujf
 * @title: MyLongToByteEncoder
 * @date 2021/2/6 0006上午 10:18
 * @description: TODO
 */
public class MyLongToByteEncoder extends MessageToByteEncoder<Long> {
    @Override
    protected void encode(ChannelHandlerContext ctx, Long msg, ByteBuf out) throws Exception {
        System.out.println("输出端 编码 "+msg);
        out.writeLong(msg);
    }
}
